package inventoryServe.controller;


import inventoryServe.po.Type;
import inventoryServe.po.User;
import inventoryServe.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import inventoryServe.utils.*;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;
import inventoryServe.utils.*;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author admin
 * @since 2021-06-22
 */
@Controller

public class TypeController {
    @Autowired
    private TypeService typeService;

    // 获取类型数据
    @GetMapping("/types")
    @ResponseBody
    public Object allType() {
        List<Type> res = this.typeService.allType();
        System.out.println(res);
        if (res != null) {
            return ResUtils.Success(1,"查询成功",res);
        } else {
            return ResUtils.Fail(0,"没有数据");
        }
    }

}

